From ec140a8f07e7b494c3354ee4f1015b6531949098 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 3 Jul 2014 11:48:24 -0400 Subject: [PATCH] gdkwindow: Apply the 0x0 size bump to 1x1 before checking for the bail Otherwise, a user that calls gdk_window_resize (window, 0, 0); over and over won't properly fizzle out, and will queue a redraw. Clipped, but still. These redraws can be chatty on some platforms like Wayland, and there's no good reason to not avoid them. This was the case for resize grips. --- gdk/gdkwindow.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 0de26c1c84..15d8f0a9df 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -5355,6 +5355,11 @@ gdk_window_move_resize_internal (GdkWindow *window, return; } + if (width == 0) + width = 1; + if (height == 0) + height = 1; + /* Bail early if no change */ if (window->width == width && window->height == height && @@ -5386,11 +5391,7 @@ gdk_window_move_resize_internal (GdkWindow *window, } if (!(width < 0 && height < 0)) { - if (width < 1) - width = 1; window->width = width; - if (height < 1) - height = 1; window->height = height; } -- 2.30.2